<template>
    <el-pagination background layout="total, sizes, prev, pager, next" :total="paginationObject.total" :page-size="paginationObject.pageSize" :current-page="paginationObject.pageNum" :page-sizes="[3, 5, 10]" @current-change="currentChange" @size-change="sizeChange">
    </el-pagination>
</template>

<script>
    import {mapState} from 'vuex'
    export default {
        props: ["paginationMethod", "paginationObject"],
        computed: {
            ...mapState("order", ["order"])
        },
        methods: {
            currentChange(pageNum) {
                this.paginationMethod({
                    page: pageNum,
                    size: this.currentPageSize,
                    orderId:this.order.orderId
                });
            },
            sizeChange(pageSize) {
                this.currentPageSize = pageSize;
                this.paginationMethod({
                    page: 1,
                    size: pageSize,
                    orderId:this.order.orderId
                });
            }
        },
        data() {
            return {
                currentPageSize: 5,
            };
        },
    };
</script>

<style>
</style>
